" YUICompressor
function! YUICompressor()
    let yuicompressor_program = 'java -jar D:/tools/ourtools/yui-compressor/yuicompressor.jar --verbose'
    "
    let yui_option_charset = '--charset ' . &fileencoding
    "
    let current_file = expand('%:p')
    if match(current_file, "\.js$") != -1
        let yui_option_type = '--type js'
    elseif match(current_file, "\.css$") != -1
        let yui_option_type = '--type css'
    else
        echoerr 'Error: File "' . current_file . '" is not js or css!'
        return
    endif
    "
    let yui_option_outputfile = substitute(current_file, '\.\(js\|css\)$', '-min\.\1', "")
    if yui_option_outputfile == current_file
        echoerr 'Error: Cannot substitute filename to "-min" file!'
        return
    endif
    "
    let yui_option_outputfile = '-o ' . shellescape(yui_option_outputfile)
    let current_file = shellescape(current_file)
    "
    "
    let yui_options = yui_option_charset . ' ' . yui_option_type . ' ' . yui_option_outputfile . ' ' . current_file
    let cmd = yuicompressor_program . ' ' . yui_options
    "
    "" echo cmd
    "" return
    "
    let cmd_output = system(cmd)
    "
    echo cmd_output
endfunction
